package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.Emp;
import com.itheima.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Author：cxl
 * @Package：com.itheima.mapper
 * @Project：web-project
 * @name：EmpMapper
 * @Date：2025-09-26 12:18 pm
 * @Filename：EmpMapper
 */
@Mapper
public interface EmpMapper {
    Page<Emp> list(EmpQueryParam empQueryParam);

    //@Options(useGeneratedKeys = true, keyProperty = "id")
    Integer add(Emp emp);

    List<Emp> findAll();

    void delete(List<Integer> ids);

    Emp selectById(Integer id);

    Emp selectInfoById(Integer id);

    void update(Emp emp);

    /*
     * 统计各个职位的员工人数
     * */
    @MapKey("pos")
    List<Map<String, Object>> countEmpJobData();

    /*
     * 统计员工性别比*/
    @MapKey("name")
    List<Map> countEmpGenderData();

    /*查询*/
    Emp selectByusernameAndPassword(Emp emp);


}
